#ifndef _OCPP_VolumeWriter_H__
#define _OCPP_VolumeWriter_H__

#include "VolumeDef.h"
#include "GridData.h"

namespace OCPP
{
	namespace Volume
	{
		class _volumeExport VolumeWriter
		{
		public:
			virtual ~VolumeWriter();
			virtual bool write(GridData& ncGridData, const VolumeOptions& ncOptions);
			virtual bool write(const VolumeGridData& ncGridData, const VolumeOptions& ncOptions);
			virtual String generateOutputName(const VolumeGridData& ncGridData, const VolumeOptions& ncOptions);
			virtual std::unique_ptr<std::ostream> getOutStream(const GridData& ncGridData, const VolumeOptions& ncOptions, bool binary);
			virtual std::unique_ptr<std::ostream> getOutStream(const VolumeGridData& ncGridData, const VolumeOptions& ncOptions);

			void setOutputPath(const String path) { _outputPath = path; }
			const String getOutputPath() const { return _outputPath; }

			void setGZipCompress(bool value) { _gzCompress = value; }
			const bool getGZipCompress() const { return _gzCompress; }

			void setMakeDirForFile(bool value) { _mkdirForFile = value; }
			const bool getMakeDirForFile() const { return _mkdirForFile; }

			void setDimSeperator(String value) { _dimSeperator = value; }
			String getDimSeperator() const { return _dimSeperator; }

			void setFillValue(float value) { _fillValue = value; }
			float getFillValue() const { return _fillValue; }

			void setFixValue(float value) { _fixValue = value; }
			float getFixValue() const { return _fixValue; }

			void setGenerateNormal(bool value) { _generateNormal = value; }
			const bool getGenerateNormal() const { return _generateNormal; }

			void setGenerateIsoValues(FloatVector value) { _isoValues = value; }

			std::optional<String> customOutputName;
		protected:
			virtual void onWriteDone(std::ostream& ostream) {}
			FloatVector _isoValues;
			float _fixValue = 0.0f;
			float _fillValue = 0.0f;
			bool	_generateNormal = true;
			bool	_gzCompress = false;
			bool	_mkdirForFile = false;
			bool	_binary = false;
			String _dimSeperator = "_";
			String _outputPath;
			String _typeExtension;
		};
	}
}


#endif // !_OCPP_NcOptions_H__
